﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Default.aspx.vb" Inherits="WebApplication1.Home" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            font-size: large;
        }
    </style>
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<p>
<br />
</p>

    <asp:Panel ID="Panel3" runat="server" Height="99px">
        Welcom to the Chinese Spirit. You can get much information in this website.
        <br /><br />
        If you want to get more information, just click the picture, and it will show you more inforamtion.
        <br /><br />
        Of course, you can express you opinion for each spirit you like. But please login or register at first. Just enjoy youself during the visiting.
        <br />
    </asp:Panel>

<p>
</p>
<p>
</p>

<div style="position:absolute">  
        <span class="style1">The Lastest Uploaded Spirit:<br /><br /></span>
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                DataSourceID="SqlDataSource1" Height="50px" Width="125px">
                <Fields>
                    <asp:TemplateField HeaderText="Time">
                        <ItemTemplate>
                            <%# Eval("uploadDate")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="spiritName" HeaderText="Name" 
                        SortExpression="spiritName" >
                    <ControlStyle Font-Bold="False" Font-Italic="False" Font-Strikeout="False" />
                    <FooterStyle Font-Bold="True" Font-Italic="True" Font-Size="1.5em" />
                    <ItemStyle CssClass="spiritName" />
                    </asp:BoundField>
                    <asp:BoundField DataField="spiritPrice" HeaderText="Price" 
                        SortExpression="spiritPrice" >
                    <ControlStyle Font-Bold="True" Font-Italic="True" />
                    <ItemStyle CssClass="spiritPrice" />
                    </asp:BoundField>
                    <asp:BoundField DataField="percentageAlochol" HeaderText="Percentage Alochol" 
                        SortExpression="percentageAlochol" >
                    <ItemStyle CssClass="percentageAlochol" />
                    </asp:BoundField>
                    
                    <asp:HyperLinkField DataNavigateUrlFields="producedIn" 
                        DataNavigateUrlFormatString="https://maps.google.co.uk/maps?q={0}" 
                        DataTextField="producedIn" HeaderText="Produced In" SortExpression="producedIn" >
                    <FooterStyle 
                        CssClass="producedIn" /><HeaderStyle CssClass="producedIn" /><ItemStyle 
                        CssClass="producedIn" /></asp:HyperLinkField>
                    <asp:HyperLinkField DataNavigateUrlFields="manuWebsite" 
                        DataTextField="manufacturer" HeaderText="Manufacturer" SortExpression="manufacturer">
                    <ItemStyle 
                        CssClass="manufacturer" /></asp:HyperLinkField>
                    <asp:TemplateField HeaderText="Picture">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID","nonLoginDetails.aspx?ID={0}") %>'>
                            <asp:Image src='<%# Eval("picture") %>' ID="Image1" runat="server" CssClass="listPicture" />  
                        </asp:HyperLink></ItemTemplate><ControlStyle CssClass="listPicture" />
                    </asp:TemplateField>
                </Fields>
            </asp:DetailsView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:SpiritConnString %>" 
                ProviderName="<%$ ConnectionStrings:SpiritConnString.ProviderName %>" 
                SelectCommand="SELECT * FROM [SpiritList] ORDER BY [uploadDate] DESC">
            </asp:SqlDataSource>
</div>


<div style="position:absolute; margin-left: 300px; margin-top: 0px;">
        <span class="style1">The Most Popular Spirit:<br /><br /></span>
                <asp:DetailsView ID="DetailsView2" runat="server" Height="50px" 
                Width="125px" AutoGenerateRows="False" DataSourceID="SqlDataSource2">
                <Fields>
                    <asp:TemplateField HeaderText="Views">
                        <ItemTemplate>
                            There are <%# Eval("UserNameCount")%> people viewed this spirit
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="spiritName" HeaderText="Name" 
                        SortExpression="spiritName" >
                    <ControlStyle Font-Bold="False" Font-Italic="False" Font-Strikeout="False" />
                    <FooterStyle Font-Bold="True" Font-Italic="True" Font-Size="1.5em" />
                    <ItemStyle CssClass="spiritName" />
                    </asp:BoundField>
                    <asp:BoundField DataField="spiritPrice" HeaderText="Price" 
                        SortExpression="spiritPrice" >
                    <ControlStyle Font-Bold="True" Font-Italic="True" />
                    <ItemStyle CssClass="spiritPrice" />
                    </asp:BoundField>
                    <asp:BoundField DataField="percentageAlochol" HeaderText="Percentage Alochol" 
                        SortExpression="percentageAlochol" >
                    <ItemStyle CssClass="percentageAlochol" />
                    </asp:BoundField>
                    <asp:HyperLinkField DataNavigateUrlFields="producedIn" 
                        DataNavigateUrlFormatString="https://maps.google.co.uk/maps?q={0}" 
                        DataTextField="producedIn" HeaderText="Produced In" SortExpression="producedIn" >
                    <FooterStyle 
                        CssClass="producedIn" /><HeaderStyle CssClass="producedIn" /><ItemStyle 
                        CssClass="producedIn" /></asp:HyperLinkField>
                    <asp:HyperLinkField DataNavigateUrlFields="manuWebsite" 
                        DataTextField="manufacturer" HeaderText="Manufacturer" SortExpression="manufacturer">
                    <ItemStyle 
                        CssClass="manufacturer" /></asp:HyperLinkField>
                    <asp:TemplateField HeaderText="Picture">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID","nonLoginDetails.aspx?ID={0}") %>'>
                            <asp:Image src='<%# Eval("picture") %>' ID="Image1" runat="server" CssClass="listPicture" />  
                        </asp:HyperLink></ItemTemplate><ControlStyle CssClass="listPicture" />
                    </asp:TemplateField>
                </Fields>
            </asp:DetailsView>                   
      

        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SpiritConnString %>" 
            ProviderName="<%$ ConnectionStrings:SpiritConnString.ProviderName %>" 
            SelectCommand="SELECT [spiritName], [spiritPrice], [percentageAlochol], [producedIn], [manufacturer], [manuWebsite], [detail], [picture], [uploadDate], [ID], [UserNameCount] FROM [SpiritViewedCountView] ORDER BY [UserNameCount] DESC">
        </asp:SqlDataSource>
        
    
</div >
     

<div style="position:absolute; margin-left: 600px; margin-top: 0px;">
    <span class="style1">The Most Like Spirit:<br /><br /></span>
    <asp:DetailsView ID="DetailsView3" runat="server" Height="50px" Width="125px" 
        AutoGenerateRows="False" DataKeyNames="ID" DataSourceID="SqlDataSource3">
                <Fields>
                    <asp:TemplateField HeaderText="Likes">
                        <ItemTemplate>
                            There are <%# Eval("IDCount")%> people liked this spirit
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="spiritName" HeaderText="Name" 
                        SortExpression="spiritName" >
                    <ControlStyle Font-Bold="False" Font-Italic="False" Font-Strikeout="False" />
                    <FooterStyle Font-Bold="True" Font-Italic="True" Font-Size="1.5em" />
                    <ItemStyle CssClass="spiritName" />
                    </asp:BoundField>
                    <asp:BoundField DataField="spiritPrice" HeaderText="Price" 
                        SortExpression="spiritPrice" >
                    <ControlStyle Font-Bold="True" Font-Italic="True" />
                    <ItemStyle CssClass="spiritPrice" />
                    </asp:BoundField>
                    <asp:BoundField DataField="percentageAlochol" HeaderText="Percentage Alochol" 
                        SortExpression="percentageAlochol" >
                    <ItemStyle CssClass="percentageAlochol" />
                    </asp:BoundField>
                    <asp:HyperLinkField DataNavigateUrlFields="producedIn" 
                        DataNavigateUrlFormatString="https://maps.google.co.uk/maps?q={0}" 
                        DataTextField="producedIn" HeaderText="Produced In" SortExpression="producedIn" >
                    <FooterStyle 
                        CssClass="producedIn" /><HeaderStyle CssClass="producedIn" /><ItemStyle 
                        CssClass="producedIn" /></asp:HyperLinkField>
                    <asp:HyperLinkField DataNavigateUrlFields="manuWebsite" 
                        DataTextField="manufacturer" HeaderText="Manufacturer" SortExpression="manufacturer">
                    <ItemStyle 
                        CssClass="manufacturer" /></asp:HyperLinkField>
                    <asp:TemplateField HeaderText="Picture">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID","nonLoginDetails.aspx?ID={0}") %>'>
                            <asp:Image src='<%# Eval("picture") %>' ID="Image1" runat="server" CssClass="listPicture" />  
                        </asp:HyperLink></ItemTemplate><ControlStyle CssClass="listPicture" />
                    </asp:TemplateField>
                </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SpiritConnString %>" 
        ProviderName="<%$ ConnectionStrings:SpiritConnString.ProviderName %>" 
        SelectCommand="SELECT [spiritName], [IDCount], [percentageAlochol], [spiritPrice], [ID], [producedIn], [manufacturer], [manuWebsite], [diner_fkid], [detail], [picture], [uploadDate] FROM [SpiritLikeCountView] ORDER BY [IDCount] DESC">
    </asp:SqlDataSource>
</div>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <p>
    </p>
    <p>
    </p>
    </asp:Content>
